package com.whjz.dcfs.jzxx.struts.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.whjz.dcfs.jzxx.dao.IDcfsSbYtJbxxDAO;
import com.whjz.dcfs.jzxx.model.DcfsSbYtJbxx;
import com.whjz.dcfs.util.BaseAction;

public class JZSBYTAction extends BaseAction{

	private static final long serialVersionUID = 1L;
	@Autowired
	public IDcfsSbYtJbxxDAO dcfsSbYtJbxxDAO;
	
	private DcfsSbYtJbxx dcfsSbYtJbxx;

	public void getDcfsSbYtJbxxListByCond() throws Exception{
		try{
			getHttpServletResponse().setCharacterEncoding("utf-8");
			List<DcfsSbYtJbxx> list=dcfsSbYtJbxxDAO.getDcfsSbYtJbxxListByCond(dcfsSbYtJbxx);
			StringBuffer sb=new StringBuffer();
			sb.append("{root:[");
			if(list!=null&&list.size()>0){
				for(int i=0;i<list.size();i++){					
					sb.append("{");
					sb.append("YT_BH:'"+list.get(i).getYtbh()+"',");
					sb.append("YT_MC:'"+list.get(i).getYtmc()+"',");
					sb.append("YT_LB:'"+list.get(i).getYtlb()+"'");
					sb.append("}");					
					if(i < list.size()-1){
						sb.append(",");
					}					
				}
				
			}
		     sb.append("]}");
		     getHttpServletResponse().getWriter().println(sb);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public DcfsSbYtJbxx getDcfsSbYtJbxx() {
		return dcfsSbYtJbxx;
	}

	public void setDcfsSbYtJbxx(DcfsSbYtJbxx dcfsSbYtJbxx) {
		this.dcfsSbYtJbxx = dcfsSbYtJbxx;
	}
	
}
